﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="保护器库存管理.aspx.cs" Inherits="syc.Fc.保护器库存管理" %>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<form id="form1" runat="server">
<asp:Label ID="SqlText" runat="server" Text="" Visible="false"></asp:Label>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>"
onselected="SqlDataSource1_Selected" 
DeleteCommand="delete from 自产保护器判定单 where ID=@ID;"
>
<DeleteParameters>
<asp:Parameter Name="ID" DbType="Int32" Size="4" />
</DeleteParameters>
</asp:SqlDataSource>

<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
    SelectCommand="select 0 as ID,'全部' as 名称 union all SELECT [ID], [名称] FROM [原料供货单位]" ></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
    SelectCommand="select 0 as ID,'全部' as 名称 union all SELECT [ID], [名称] FROM [材料供货单位]" ></asp:SqlDataSource>


<div id="wintop" class="wintop">保护器库存管理</div>

<asp:Panel ID="Panel1" runat="server" CssClass="panel">
    <input type="button" value="入 库" class="button" onclick="parent.swin2_load('/Fc/保护器入库单录入.aspx',560,320);"/>
    <input type="button" value="出 库" class="button" onclick="parent.swin2_load('/Fc/保护器出库单录入.aspx',560,256);"/>
    <asp:Button ID="Button_Edit" runat="server" Text="修 改" CssClass="button" UseSubmitBehavior="False"/>
    <asp:Button ID="Button_View" runat="server" Text="查看单据" CssClass="button" UseSubmitBehavior="False"/>
    <asp:Button ID="Button_Delete" runat="server" Text="删 除" CssClass="button"  
        UseSubmitBehavior="False" 
        OnClientClick="if(!confirm('确认要删除该条记录吗？'))return(false);" 
        onclick="Button_Delete_Click" />
</asp:Panel>

<asp:Panel ID="Panel2" runat="server" CssClass="panel" GroupingText="记录查询">

相关分厂：<asp:DropDownList ID="FenChang" runat="server" Width="120">
<asp:ListItem Value="0">全部</asp:ListItem>
<asp:ListItem Value="1">一分厂</asp:ListItem>
<asp:ListItem Value="2">二分厂</asp:ListItem>
<asp:ListItem Value="3">三分厂</asp:ListItem>
<asp:ListItem Value="4">四分厂</asp:ListItem>
<asp:ListItem Value="5">五分厂</asp:ListItem>
</asp:DropDownList>
<span style="margin-left:10px;">铁质供货：</span><asp:DropDownList ID="TieZhi" runat="server" Width="120" 
        DataSourceID="SqlDataSource2" DataTextField="名称" DataValueField="ID"></asp:DropDownList>
<span style="margin-left:10px;">塑质供货：</span><asp:DropDownList ID="SuZhi" runat="server" Width="120" 
        DataSourceID="SqlDataSource3" DataTextField="名称" DataValueField="ID"></asp:DropDownList>
<div style="font-size:6px;height:6px;line-height:6px;"></div>

日期范围：<asp:TextBox ID="Date1" runat="server" CssClass="textbox" Width="105px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" />
至<asp:TextBox ID="Date2" runat="server" CssClass="textbox" Width="105px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date2').value, document.getElementById('Date2'));" />
<span style="margin-left:10px;">入库判定：</span><asp:DropDownList ID="PanDing" runat="server" Width="184">
<asp:ListItem Value="-1">全部显示</asp:ListItem>
<asp:ListItem Value="1">仅显示判定合格的记录</asp:ListItem>
<asp:ListItem Value="0">仅显示未判定合格的记录</asp:ListItem>
</asp:DropDownList>
<span style="margin-left:10px;"></span>

<asp:Button ID="Button_Query" runat="server" Text="查 询" UseSubmitBehavior="false" 
        CssClass="mbutton" onclick="Button_Query_Click" />

<asp:Button ID="Button_Reset" runat="server" Text="清空条件" UseSubmitBehavior="false" 
        CssClass="mbutton" onclick="Button_Reset_Click" />
</asp:Panel>


<div class="gridframe">
    <div class="gridview">
    
        <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#e5cfab">
            <tr>
	            <td class="grid-title">保护器入出库记录</td>
	        </tr>
	        <tr>
	            <td class="grid-back">
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                        AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID,套数,合格" 
                        DataSourceID="SqlDataSource1"
                        PageSize="10"
                        GridLines="None" ondatabound="GridView1_DataBound" 
                        onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                        UseAccessibleHeader="False" 
                        onselectedindexchanged="GridView1_SelectedIndexChanged">
                        <PagerSettings Visible="False" />
                        <RowStyle CssClass="grid-row-normal" />
                        <Columns>
                        
                            <asp:TemplateField HeaderText="">
                                <ItemTemplate>
                                    <asp:Button ID="Button_xz" runat="server" CommandName="Select" Text="选择" CssClass="hide"/>
                                    <img src="/Icons/online.gif" style="margin-top:2px;" alt="" />
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="入出">
                                <ItemTemplate>
                                    <asp:Label ID="Label_rc" runat="server" Text='<%# Eval("入出") %>' ForeColor='<%# ((int)Eval("套数"))>0?System.Drawing.Color.Green:System.Drawing.Color.Red %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="center" Width="80px"/>
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="品名">
                                <ItemTemplate>
                                    <asp:Label ID="Label_pm" runat="server" Text='<%# Eval("品名") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="left" Width="100px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="铁质供应商">
                                <ItemTemplate>
                                    <asp:Label ID="Label_tz" runat="server" Text='<%# Eval("铁质") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="left" Width="100px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="塑质供应商">
                                <ItemTemplate>
                                    <asp:Label ID="Label_sz" runat="server" Text='<%# Eval("塑质") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="left" Width="100px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="套数">
                                <ItemTemplate>
                                    <asp:Label ID="Label_ts" runat="server" Text='<%# Eval("套数") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="center" Width="70px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="件数">
                                <ItemTemplate>
                                    <asp:Label ID="Label_js" runat="server" Text='<%# Eval("件数") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="center" Width="70px" />
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="日期" SortExpression="日期">
                                <ItemTemplate>
                                    <asp:Label ID="Label_rq" runat="server" Text='<%# Eval("日期","{0:d}") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="center" Width="70px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="合格">
                                <ItemTemplate>
                                    <asp:Image ID="Image_hg" runat="server" ImageUrl='<%#  "/Images/hege_"+Eval("合格").ToString() +".png" %>' Visible='<%# (int)Eval("套数")>0 %>' />
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="40px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="录入">
                                <ItemTemplate>
                                    <asp:Label ID="Label_zp" runat="server" Text='<%# Eval("制票") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="center" Width="60px" />
                            </asp:TemplateField>
                            
                        </Columns>
                        <SelectedRowStyle CssClass="grid-row-selected" />
                      </asp:GridView>
	            </td>
            </tr>
            <tr>
	            <td>   
	                <table width="100%">
	                    <tr>
	                        <td class="pagebar">
                                <asp:Button ID="Button_Pager_First" UseSubmitBehavior="false" runat="server" Text="" ToolTip="首页" 
                                    CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                <asp:Button ID="Button_Pager_Prev" UseSubmitBehavior="false" runat="server" Text="" ToolTip="上一页" 
                                    CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                <input type="button" class="page-split" UseSubmitBehavior="false" disabled />第<asp:TextBox 
                                    ID="TextBox_Pager" AutoPostBack="True" runat="server" CssClass="pageturn" 
                                    ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" disabled /><asp:Label ID="Label_Pages" UseSubmitBehavior="false" runat="server"></asp:Label><input type="button" class="page-split" disabled />
                                
                                <asp:Button ID="Button_Pager_Next" UseSubmitBehavior="false" runat="server" Text="" ToolTip="下一页" 
                                    CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                <asp:Button ID="Button_Pager_Last" UseSubmitBehavior="false" runat="server" Text="" ToolTip="末页" 
                                    CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" /><asp:Label ID="Label9" runat="server"></asp:Label><input type="button" class="page-split" disabled />
                            </td>
                            <td class="pagebar" align="right">
                                <asp:Label ID="Label_Total" runat="server"></asp:Label>
                            </td>
                        </tr>
                   </table>

	            </td>
            </tr>
        </table>
        

    </div>
</div>

</form>
<script>
    var notice = '<%=this.Notice %>';
    if (notice != '') {
        parent.showmsgbox(notice);
    }
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            //textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }
    }
    var rows = document.getElementsByTagName("tr");
    for (i = 0; i < rows.length; i++) {

        if (rows[i].className == "grid-row-normal") {
            rows[i].onmouseover = function() { this.className = "grid-row-bright"; };
            rows[i].onmouseout = function() { this.className = "grid-row-normal"; };
            rows[i].onclick = selectRow;
        }
    }

</script>
</body>
</html>
